import i18n from '@/lang'
import Vue from "vue";
// 车辆版本列表表头,列带有special属性值为true时，说时需要单独处理单元中的值
export const vehicleVersionTbColumns = [{
  title: '智驾域版本',
  dataIndex: 'name',
  scopedSlots: {
    customRender: 'vehicleVersion'
  },
  width: 150
}, {

  dataIndex: 'approved',
  slots: {
    title: 'isApproval'
  },
  titleName:i18n.t('isApproval'),
  scopedSlots: {
    customRender: 'isApproval'
  },
  width: 140,
  special: true
}, {
  title: i18n.t('carSeriesName'),
  dataIndex: 'carSeriesName',
  scopedSlots: {
    customRender: 'carSeriesName'
  },
  width: 110,
  special: true
}, {
  title: i18n.t('modelName'),
  dataIndex: 'modelName',
  scopedSlots: {
    customRender: 'modelName'
  },
  width: 150,
  special: true
}, {
  title: i18n.t('modelCode'),
  dataIndex: 'modelCode',
  scopedSlots: {
    customRender: 'modelCode'
  },
  width: 140,
  special: true
}, {
  title: i18n.t('stereotype'),
  dataIndex: 'trimLevel',
  scopedSlots: {
    customRender: 'stereotype'
  },
  width: 90
}, {
  title: i18n.t('timeOfCreation'),
  dataIndex: 'createTime',
  scopedSlots: {
    customRender: 'timeOfCreation'
  },
  width: 160,
  special: true,
  sorter: true
}, {
  title: i18n.t('creator'),
  dataIndex: 'createBy',
  scopedSlots: {
    customRender: 'createBy'
  },
  width: 80
}, {
  title: i18n.t('operation'),
  dataIndex: 'operation',
  scopedSlots: {
    customRender: 'action'
  },
  special: true,
  width: 170,
  fixed: 'right'
}]

// 选择零件版本配置列表表头
export const ecuVersionConfigColumns = [{
//   title: i18n.t('表单编号'),
//   dataIndex: 'version.softFormNo',
//   scopedSlots: {
//     customRender: 'version.softFormNo'
//   },
//   width: 120
// }, {
  title: i18n.t('partName'),
  dataIndex: 'partName',
  scopedSlots: {
    customRender: 'partName'
  },
  width: 160
}, {
  title: i18n.t('partNumber'),
  dataIndex: 'showEcuId',
  scopedSlots: {
    customRender: 'partNumber'
  },
  width: 160
}, {
  title: i18n.t('softwareCoding'),
  dataIndex: 'softwareCode',
  scopedSlots: {
    customRender: 'softwareCoding'
  },
  width: 160
},
{
  title: i18n.t('versionType'),
  dataIndex: 'versionType',
  width: 130,
  special: true,
  customRender: (text, record, index) => {
    return Vue.$store.getters.getDictCodeObj('versionTypeDictCode')[text] || text;
  },
},
{
  title: i18n.t('ecuVersion'),
  dataIndex: 'versionlists',
  scopedSlots: {
    customRender: 'ecuVersion'
  },
  width: 300,
  special: true
},
{
  title: i18n.t('wholePackage'),
  dataIndex: 'wholePackageCount',
  scopedSlots: {
    customRender: 'wholePackageCount'
  },
  width: 100,
  special: true
},
{
  title: i18n.t('differentialNum'),
  dataIndex: 'patchPackageCount',
  customRender(text, record) {
    return text ? text : 0
  },
  width: 100,
  special: true
},
{
  title: i18n.t('releaseNote'),
  dataIndex: 'releaseNotes',
  scopedSlots: {
    customRender: 'versionDesc'
  },
  width: 100,
  special: true
},
{
  title: i18n.t('configFileVersion'),
  dataIndex: 'configVersionName',
  scopedSlots: {
    customRender: 'configFileVersion'
  },
  width: 140
}, {
  slots: { title: 'dependentGroupingColumn' },
  dataIndex: 'dependentGrouping',
  scopedSlots: {
    customRender: 'dependentGrouping'
  },
  width: 120
}, 
// {
//   slots: { title: 'isRollbackColumn' },
//   dataIndex: 'groupRollback',
//   scopedSlots: {
//     customRender: 'isRollback'
//   },
//   width: 120
// }, 
{
  slots: { title: 'updateOrderColumn' },
  dataIndex: 'upgradeNo',
  scopedSlots: {
    customRender: 'updateOrder'
  },
  width: 120
// }, {
//   title: i18n.t('工程院表单编号'),
//   dataIndex: 'version.gcyFormNo',
//   scopedSlots: {
//     customRender: 'version.gcyFormNo'
//   },
//   width: 120
}]
